import { Component, OnInit } from '@angular/core';
import { timer } from 'rxjs';

import { GlobalSpinService } from '@core/base';

@Component({
  selector: 'app-global-spin',
  templateUrl: './global-spin.component.html'
})
export class GlobalSpinComponent implements OnInit {
  constructor(private globalSpinSrc: GlobalSpinService) {}
  ngOnInit(): void {}

  loading(): void {
    this.globalSpinSrc.pulish(true);
    timer(3000).subscribe(() => this.globalSpinSrc.pulish(false));
  }
}
